# Maintainer: Frederik Schwan <freswa at archlinux dot org>
# Contributor: dracorp aka Piotr Rogoza <piotr.r.public at gmail.com>
# Contributor:  TDY <tdy@gmx.com>
# Contributor: François Charette <firmicus ατ gmx δοτ net>

pkgname=perl-par
pkgver=1.018
pkgrel=1
pkgdesc='Perl Archive Toolkit'
arch=('any')
url='https://metacpan.org/release/PAR'
license=('GPL')
depends=('perl-archive-zip' 'perl-par-dist')
options=('!emptydirs' purge)
source=("https://cpan.metacpan.org/authors/id/R/RS/RSCHUPP/PAR-${pkgver}.tar.gz")
b2sums=('e43be438dda3b3fcac1fc2b127d5081662567b492f367133c765d967803af1db2a2bbe258492109f2e5a41e864acd4a87ed551ceae3ebc5a529f1c07d7aa2fbc')

build() {
  cd PAR-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
  perl Makefile.PL
  make
}
check(){
  cd PAR-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1
  make test
}
package() {
  cd PAR-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  make install INSTALLDIRS=vendor DESTDIR="${pkgdir}"
}
